<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib uri="/typeUtil"  prefix="typeUtil"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>续住页面</title>
</head>
<body>
	<input id="checkInId" type='hidden' value='${checkIn.id }'>
	当前入住信息:<br>
	房间类型:${typeUtil:getTypeName(room.typeId)}<br>
	房间名称:${room.name}<br>
	楼层:${room.floor }<br>
	单价:${typeUtil:getTypePrice(room.typeId)*room.discount/100.0 }元/日<br>
	当前总费用:${checkIn.cost }<br>
	入住时间:${checkIn.inTime }<br>
	当前退房时间:${checkIn.outTime }<br>
	请选择:<br>
	新的退房日期：<input type="text" id="newOutDate"><br>
	备注:<textarea rows="20" cols="20" id="zcomment"></textarea>
	<button id="continueBut">续住</button>
</body>

<script type="text/javascript" src="/hotel/js/jquery.min.js"></script>
<script type="text/javascript" src="/hotel/js/timeUtil.js"></script>
<script type="text/javascript">
	$('#continueBut').click(function(){
		data={'checkId':$('#checkInId').val(),'newOutDate':$('#newOutDate').val()}
		$.post('/hotel/continueBook/checkContinue',data,function(str){
			var res=eval('(' +str + ')')
			if(res.code!=0){
				alert(res.message)
				return;
			}
			if(!confirm('续住共需'+res.object+'元，您确定续住吗？'))
				return 
			data={'checkId':$('#checkInId').val(),'newOutDate':$('#newOutDate').val(),"zcomment":$('#zcomment').val()}
			//alert(JSON.stringify(data))
			$.post('/hotel/continueBook/continueBook',data,function(str){
				var res=eval('(' +str + ')')
				if(res.code!=0){
					alert(res.message)
					return;
				}
				window.location.href="/hotel/system/mainPage"
			})
		})
	})
</script>
</html>